package com.neouton.feginClient;

import com.neouton.common.util.ResponseAPI;
import com.neouton.common.entity.ActivitiVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(url = "${workFlow.server}", name = "workFlow")
public interface WorkFlowFeginService {

    /**
     * 获取所有流程设计名称和code
     */
    @GetMapping("/api/getProcessDesignNameAndCode")
    ResponseAPI getProcessDesignNameAndCode();

    /**
     * 获取流程设计名称、code、版本号及流程部署id
     */
    @GetMapping("/api/getProcessDesignNameAndCodeAndVersion")
    ResponseAPI getProcessDesignNameAndCodeAndVersion();

    /**
     * 启动工作流，按最大版本号
     */
    @PostMapping("/api/startProcessByDesignCode")
    ResponseAPI<ActivitiVO> startProcessByDesignCode(@RequestBody ActivitiVO activitiVO);

    /**
     * 启动工作流，按指定版本号
     */
    @PostMapping("/api/startProcessByDesignCodeAndVersion")
    ResponseAPI<ActivitiVO> startProcessByDesignCodeAndVersion(@RequestBody ActivitiVO activitiVO);

    /**
     * 更具域账号获取待办列表
     */
    @PostMapping("api/getTasksByAuthorization")
    ResponseAPI<List<ActivitiVO>> getTasksByAuthorization(@RequestBody ActivitiVO activitiVO);

    /**
     * 审批流程
     */
    @PostMapping("api/approvalProcessByBusinessId")
    ResponseAPI approvalProcessByBusinessId(@RequestBody ActivitiVO activitiVO);

    /**
     * 驳回至前一节点
     */
    @PostMapping("api/rejectedByBusinessId")
    ResponseAPI rejectedByBusinessId(@RequestBody ActivitiVO activitiVO);

    /**
     * 驳回至指定节点
     */
    @PostMapping("api/backProcess")
    ResponseAPI backProcess(@RequestBody ActivitiVO activitiVO);

    /**
     * 启动流程，动态指定下一审批人,按制定版本号启动
     */
    @PostMapping("api/startProcessByDesignCodeVersionCustomParams")
    ResponseAPI<ActivitiVO> startProcessByDesignCodeVersionCustomParams(@RequestBody ActivitiVO activitiVO);

    /**
     * 启动流程，动态指定下一审批人,按最大版本号启动
     */
    @PostMapping("api/startMaxVersionProcessByDesignCodeCustomParams")
    ResponseAPI<ActivitiVO> startMaxVersionProcessByDesignCodeCustomParams(@RequestBody ActivitiVO activitiVO);

    /**
     * 流程启动，设定所以审批人员信息
     */
    @PostMapping("api/startProcessByDesignCodeVersionBatchCustomParams")
    ResponseAPI<ActivitiVO> startProcessByDesignCodeVersionBatchCustomParams(@RequestBody ActivitiVO activitiVO);

    /**
     * 流程启动，动态批量入参
     */
    @PostMapping("api/approvalProcessCustomUserByBusinessId")
    ResponseAPI approvalProcessCustomUserByBusinessId(@RequestBody ActivitiVO activitiVO);

    /**
     * 删除流程实例
     */
    @PostMapping("api/deleteInstance")
    ResponseAPI deleteInstance(@RequestBody ActivitiVO activitiVO);

    /**
     * 删除流程实例
     */
    @PostMapping("api/getProcessNodeNameAndCode")
    ResponseAPI<ActivitiVO> getProcessNodeNameAndCode(@RequestBody ActivitiVO activitiVO);

}
